.class Lcom/xingbook/ting/lyric/i;
.super Landroid/os/Handler;


# instance fields
.field a:Ljava/lang/ref/WeakReference;


# direct methods
.method public constructor <init>(Lcom/xingbook/ting/lyric/LyricView;)V
    .locals 1

    invoke-direct {p0}, Landroid/os/Handler;-><init>()V

    new-instance v0, Ljava/lang/ref/WeakReference;

    invoke-direct {v0, p1}, Ljava/lang/ref/WeakReference;-><init>(Ljava/lang/Object;)V

    iput-object v0, p0, Lcom/xingbook/ting/lyric/i;->a:Ljava/lang/ref/WeakReference;

    return-void
.end method


# virtual methods
.method public handleMessage(Landroid/os/Message;)V
    .locals 4

    invoke-super {p0, p1}, Landroid/os/Handler;->handleMessage(Landroid/os/Message;)V

    iget-object v0, p0, Lcom/xingbook/ting/lyric/i;->a:Ljava/lang/ref/WeakReference;

    invoke-virtual {v0}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/ting/lyric/LyricView;

    if-eqz v0, :cond_0

    invoke-static {v0}, Lcom/xingbook/ting/lyric/LyricView;->b(Lcom/xingbook/ting/lyric/LyricView;)Lcom/xingbook/ting/lyric/d;

    move-result-object v1

    if-nez v1, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    invoke-static {v0}, Lcom/xingbook/ting/lyric/LyricView;->b(Lcom/xingbook/ting/lyric/LyricView;)Lcom/xingbook/ting/lyric/d;

    move-result-object v1

    iget-boolean v1, v1, Lcom/xingbook/ting/lyric/d;->b:Z

    if-eqz v1, :cond_3

    iget-boolean v1, v0, Lcom/xingbook/ting/lyric/LyricView;->d:Z

    if-eqz v1, :cond_3

    :try_start_0
    invoke-static {v0}, Lcom/xingbook/ting/lyric/LyricView;->d(Lcom/xingbook/ting/lyric/LyricView;)Landroid/media/MediaPlayer;

    move-result-object v1

    if-eqz v1, :cond_2

    invoke-static {v0}, Lcom/xingbook/ting/lyric/LyricView;->d(Lcom/xingbook/ting/lyric/LyricView;)Landroid/media/MediaPlayer;

    move-result-object v1

    invoke-virtual {v1}, Landroid/media/MediaPlayer;->isPlaying()Z

    move-result v1

    if-eqz v1, :cond_2

    iget-object v1, v0, Lcom/xingbook/ting/lyric/LyricView;->a:Lcom/xingbook/ting/lyric/h;

    invoke-static {v0}, Lcom/xingbook/ting/lyric/LyricView;->d(Lcom/xingbook/ting/lyric/LyricView;)Landroid/media/MediaPlayer;

    move-result-object v0

    invoke-virtual {v0}, Landroid/media/MediaPlayer;->getCurrentPosition()I

    move-result v0

    int-to-long v2, v0

    invoke-virtual {v1, v2, v3}, Lcom/xingbook/ting/lyric/h;->a(J)V

    :cond_2
    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lcom/xingbook/ting/lyric/i;->sendEmptyMessage(I)Z
    :try_end_0
    .catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    goto :goto_0

    :cond_3
    iget-object v0, v0, Lcom/xingbook/ting/lyric/LyricView;->a:Lcom/xingbook/ting/lyric/h;

    invoke-virtual {v0}, Lcom/xingbook/ting/lyric/h;->invalidate()V

    goto :goto_0
.end method
